<template>
  <div class="category-tabs">
    <ul class="tabs-bar-nav">
      <li class="tabs-tab" :class="[tabIndex == item.index ? 'tab-active' : '']"
          v-for="(item,index) in tabList"
          @click="changeCategory(item)" :key="index">
        {{item.name}}
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  props: ["tabList", "tabIndex"],
  data() {
    return {};
  },
  methods: {
    changeCategory(item) {
      this.$emit("changeCategory", item);
    }
  }
};
</script>
<style lang="less" scoped>
.tabs-bar-nav {
  .tabs-tab {
    display: inline-block;
    padding: 0 8px;
    color: #696969;
    cursor: pointer;
  }
  .tabs-tab:after {
    content: "|";
    color: #696969;
    padding-left: 10px;
  }
  .tab-active {
    color: #c09c52;
  }
}
</style>
